﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ExpertMIS.Codes;

namespace ExpertMIS.Admin
{
    public partial class UserAuditForm : AdminAuthenticationPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (string.IsNullOrEmpty(Request["oid"]))
                {
                    uaColumn.LoadUser("-1");
                }
                else
                {
                    uaColumn.LoadUser(Request["oid"]);
                }
            }
        }

        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void lbSave_Click(object sender, EventArgs e)
        {
            if (uaColumn.SaveUser())
            {
                Response.Redirect("UserAuditList.aspx");
            }
        }

        /// <summary>
        /// 重置密码
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void lbResetPassword_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(Request["oid"]))
            {
                return;
            }
            uaColumn.ResetUserPasword(Request["oid"]);
        }

        protected void lbBack_Click(object sender, EventArgs e)
        {
            Response.Redirect("UserAuditList.aspx");
        }

    }
}
